package com.wjt.homestayms;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wjt.homestayms.mapper.RoomMapper;
import com.wjt.homestayms.mapper.StoreMapper;
import com.wjt.homestayms.mapper.UserMapper;
import com.wjt.homestayms.pojo.*;
import com.wjt.homestayms.service.IEmpService;
import com.wjt.homestayms.service.IRoomService;
import com.wjt.homestayms.service.IStoreService;
import com.wjt.homestayms.service.ITenantService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class DaoTest {
    @Autowired
    StoreMapper storeMapper;
    @Autowired
    UserMapper userMapper;
    @Autowired
    IStoreService storeService;
    @Autowired
    RoomMapper roomMapper;
    @Autowired
    IRoomService roomService;
    @Autowired
    IEmpService empService;
    @Autowired
    ITenantService tenantService;

    @Test
    public void test01(){
//        Room room = new Room(12, 111, "双人间", 100, "空闲", 1);
//        PageRequest pageRequest = new PageRequest(1, 2);
//        PageResult resultPage = roomService.getResultPage(pageRequest, 1);

//        PageResult resultPage = roomService.getResultPage(pageRequest, 1);
//        System.out.println("total = " +resultPage.getTotal());
//        roomService.getResultPageByRid(pageRequest,102);
//        roomService.updateRoom(room);
//        Employee emp = new Employee(3,"李四","18076355732",3100,1,"保洁员");
//        empService.deleteEmp(3);
//        empService.getEmp(pageRequest,2);
//        empService.getEmpList(pageRequest,1);

//        Tenant tenant = new Tenant(4,"赵七","458596200011121423","18076355101",1);
//        PageResult result = tenantService.getTenantByName(pageRequest, "赵七");
//        System.out.println("result= " + result);
//        PageResult tenantList = tenantService.getTenantList(pageRequest, 1);
//        System.out.println("tenant=" + tenantList);
//        tenantService.deleteTenant(4);

        Date dt=new Date();
        String mon=String .format("%tm", dt);
    }
}
